<script type="text/javascript">
function checkForm() {
	spanError = document.getElementById('error');
	var checkRegExp = new RegExp("^[ \t]*$");
	if (document.userProfile.users_password.value != document.userProfile.users_password2.value) {
		spanError.innerHTML = "<?php echo T_('Password incorrect (not the same).'); ?>";
		spanError.className = "usvn_error";
		return false;
	}
	if (document.userProfile.users_password.value.length < 8
		&& document.userProfile.users_password.value.length >= 1 ) {
		spanError.innerHTML = "<?php echo T_('Password incorrect (need more 8 characters).'); ?>";
		spanError.className = "usvn_error";
		return false;
	}
	spanError.innerHTML = '';
	spanError.className = "";
	return true;
}
</script>
<fieldset>
	<legend class="usvn_legend">
		<?php echo T_("User account"); ?>
	</legend>
	<form name="userProfile" method="post" action="<?php echo $this->url(); ?>">
		<label class="usvn_label">
			<?php echo T_("Login"); ?>: <?php echo $this->user->login; ?><br />
		</label>
		<br />
		<label class="usvn_label"><?php echo T_("Password"); ?>:<br />
			<?php echo $this->formPassword('users_password',  null); ?>
			<?php echo $this->formPassword('users_password2',  null); ?>
		</label>
		<br />
		<label class="usvn_label"><?php echo T_("Lastname"); ?>:<br />
			<?php echo $this->formText('users_lastname', (isset($this->user) ? $this->user->lastname : null), array('maxlength' => 100)); ?>
		</label>
		<br />
		<label class="usvn_label"><?php echo T_("Firstname"); ?>:<br />
			<?php echo $this->formText('users_firstname', (isset($this->user) ? $this->user->firstname : null), array('maxlength' => 100)); ?>
		</label>
		<br />
		<label class="usvn_label"><?php echo T_("Email"); ?>:<br />
			<?php echo $this->formText('users_email', (isset($this->user) ? $this->user->email : null), array('maxlength' => 150)); ?>
		</label>
		<br />
		<?php if (isset($this->user)) echo $this->formHidden('users_id', $this->user->id); ?>
		<?php echo $this->formSubmit('submit', T_("Submit"), array("onClick" => 'return checkForm();')); ?>
		<br />
		<div id="error"></div>
	</form>
</fieldset>
